package com.spring.sso.common.enums;

public enum VerificationTypeEnum {
    GET("GET", "获取验证码"),
    LOGIN("LOGIN", "验证码登陆"),
    FIND_PWD("FIND_PWD", "验证码找回密码"),
    MODIFY_PWD("MODIFY_PWD", "验证码修改密码"),
    MODIFY_PHONE("MODIFY_PHONE", "验证码修改手机号");

    private String code;
    private String name;

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    VerificationTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static VerificationTypeEnum getByCode(String code) {
        for (VerificationTypeEnum st : VerificationTypeEnum.values()) {
            if ( st.code.equals(code)) {
                return st;
            }
        }
        return null;
    }
}
